﻿
using Controller;
using Controller.i18n.entity;
using HBase;
using hCommand;
using hconnect; 
using Net.http;
using Persistence;
using System.Diagnostics;
using System.Text;

Process[] processes = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
if (processes.Length > 1)
{
    Console.WriteLine("无法重复启动");
    Console.ReadLine();
    return;
}

System.Text.EncodingProvider ppp = System.Text.CodePagesEncodingProvider.Instance;
Encoding.RegisterProvider(ppp);

Console.WriteLine("Hello, World!");
BaseConfig.Working = true;
BaseConfig.prefixal = GKDBType.mySql;
LoggerCommon.loggerMyConsole = true;
LoggerCommon.loggerInfoLoggerFile = true;
 
StatusCache.signalLife = 2000;
StatusCache.test = false;


HttpApiFacade.initTypes(-1, true);
PathFacade.register<TaskCarrier>();
PathFacade.register<TaskCrane>();
PathFacade.robotType = typeof(TaskCarrier); 
 
LoggerCommon.fileAll(InfoC.consol_start, TaskUtil.getTaskNo() + "begin working");
InitServer.start();

while (true)
{
    while (true)
    {
        object v = MyConsole.getOne();
        if (v != null)
        {
            Console.WriteLine(DateTime.Now.ToString("HH:mm:ss") + v.ToString());
            Thread.Sleep(50);
        }  else  {
            break;
        }

    }
   
    Thread.Sleep(1000);

}
